package com.niit.objectfactory;

import com.niit.entity.Student;
import org.apache.ibatis.reflection.factory.DefaultObjectFactory;

import java.util.Properties;

public class StudentObjectFactory extends DefaultObjectFactory {
    // 泛型方法
    @Override
    public <T> T create(Class<T> type) {
        if(type == Student.class){
            // 实体类的构造方法
            System.out.println("Create Student Class...");
        }
        // 实体类的构造方法
        System.out.println("Do Something when create the bean");
        return super.create(type);
    }

    @Override
    public void setProperties(Properties properties) {
        super.setProperties(properties);
    }
}
